<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>yunduansing.core--登录</title>
<meta name="keywords" content="">
<meta name="description" content="">
<!--[if lt IE 9]>
    	<script src="https://cdn.bootcss.com/html5shiv/r29/html5.min.js"></script>
    <![endif]-->
</head>
<body>
	<div>
		<form:form action="account/login" method="POST">
			<form:input path="account" placeholder="登录账号"
				type="text" />
			<br />
			<form:input path="password" placeholder="登录密码"
				type="password" />
			<br />
			<button type="button" id="btnLogin">登录</button>
		</form:form>
	</div>
	
	<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.js"></script>
	<script>
		$(function(){
			$("#btnLogin").click(function(){
				var data={"account":$("#account").val(),"password":$("#password").val()};
				$.post("account/login",data,function(result){
					if(result.flag){
						location.href='hello';
					}else{
						alert(result.msg==null?"登录失败":result);
					}
				});
			});
		});
	</script>
</body>
</html>